The present disclosure relates to computer systems, and more particularly to a method and system for encoding over-range color values using in-range values.
Digital devices that create (e.g., scanners and digital cameras), display (e.g. CRT and LCD monitors), or print (e.g. ink jet and laser printers) colors typically define color data using color spaces. Generally, a color space is a combination of a color model and a gamut. A color model defines each color within the model using color components, such as, in the case of a Red, Green, Blue (RGB) color model, the levels of red, green, and blue light components needed to create each color. Levels of each component in the RGB color model typically range from 0 to 100 percent of full intensity, or which may be represented on a scale of 0 to 1. By varying the levels or intensities of the components, each color in the color model may be created. However, as a practical matter a device is often limited in its ability to create pure red, green, or blue light, which limits its range of colors or color gamut. A gamut is simply the range of colors that may be displayed on or captured by a particular device.
The differences in device gamuts lead to differences in color spaces between two devices. For example, two devices that use RGB may show different colors when each displays its most intense red. The most intense red on a first device may have an intensity of 1 for the R component and 0 for the G and B components. However, the color that looks the same as the most intense red of the first device may have a red intensity of 0.85 on a second device. Moreover, the G and B component intensities may even be 0.05 on the second device. In other words, the same perceived “red” color has different RGB component values depending on the device, on the first device it may be (1, 0, 0) and on the second device that same “red” may be (0.85, 0.05, 0.05). This means that an image file containing only RGB values, if displayed directly by both devices, would appear differently on the two devices.
To solve this problem of the same component values appearing differently on different devices, color spaces are defined in relation to device-independent color spaces, which define colors in more absolute terms. Some examples of device-independent color spaces include the CIE XYZ and CIE L*a*b* color spaces. Many systems and applications use the sRGB color space, whose relation to the device-independent color spaces is well-known in the art. The relationship of a device's native color space with a device-independent color space typically is described by some combination of formulas, transfer functions, matrices, and look up tables. This relationship may be stored in an International Color Consortium (ICC) profile for the device. The device-independent color space may be used as an intermediate when converting from one device-dependent color space to another.
Color component values may be expressed digitally in a variety of ways. To keep the size of image files manageable, typically a certain fixed number of bits are devoted to expressing each color component of each pixel (A pixel, or picture element, is the smallest component, and basic building block, of a digital image). For example, an 8-bit per component image may express 256 discrete values of intensities for each component. That is, in an RGB image, 8-bits per channel may correspond to 256 intensity levels of Red, of Green, and of Blue component light. These 256 values may be represented as integer values ranging from 0 to 255, or decimal values ranging from 0 to 1. The decimal values may be floating point, resulting in a dynamic range of values, or may be fixed-point, resulting in a fixed range. For example, a 16-bit fixed-point value may reserve 1-bit for the sign of a decimal number, 2-bits for the integer portion of the decimal number, and 13-bits for the fractional portion of a decimal number, resulting in a fixed range ranging from −4 to 3.9998779296875 (i.e., 4−2^(−13)).